This data repository contains the data and code for the article "Estimating effect sizes of solar radiation and temperature on dissolved gaseous mercury in seawater using a proposed framework for causal inference".

The folder "workdata" contains the raw measurement data and pre-processed data.
The folder "pre-processing" contains code to pre-process the raw data.
The folder "data" is empty but is intended to contain the final data after running the models.
The folder "common_tools" contains code elements commonly used across all modules.

The code is divided into 10 modules. The modules are meant to be run sequentially.
However, after each module, the resulting data is stored in the folder "data".
Therefore, the modules can also be run independently after running the first module.

The modules are:
- module_0_dataselect.rmd: Data selection and extraction of relevant variables.
- module_1_dataload.rmd: Loading of the data and required packages.
- module_2_simulation.rmd: Creation of simulated data.
- module_3_priors.rmd: Definition of priors for the Bayesian models.
- module_4_model.rmd: Definition and Execution of the Bayesian models.
- module_5_postpredict.rmd: Posterior predictive checks.
- mdoule_6_result_plttoing.ipynb: Visualization of the results (in Python!)
- module_7_postpredict_plotting.ipynb: Visualization of the posterior predictive checks (in Python!)
- module_8_simulationdata_plotting.ipynb: Visualization of the simulated data (in Python!)
- module_9_colliders.rmd: Collider example in paper.
- module_10_plotcollider.ipynb: Visualization of the collider example (in Python!)

All library and package requirements for R and Python are listed in:
- requirements_R.txt: R packages
- requirements_Python.txt: Python packages
- mercury_environment.yaml: Conda environment file for Python packages

This data package and code are under the MIT License as specififed in the file LICENSE. 
